<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
  <title>Document</title>
</head>

<body>
  <script>
    let getUrlParams = function (curl) {
      // 解决乱码问题
      let url = curl
      let res = {}
      // eslint-disable-next-line camelcase
      let url_data = _.split(url, '?').length > 1 ? _.split(url, '?')[1] : null

      // eslint-disable-next-line camelcase
      if (!url_data) return null
      // eslint-disable-next-line camelcase
      let params_arr = _.split(url_data, '&')

      _.forEach(params_arr, function (item) {
        let key = _.split(item, '=')[0]
        let value = _.split(item, '=')[1]

        res[key] = value
      })

      let keys = Object.keys(res).sort()
      let newData = {}

      keys.map((v) => {
        newData[v] = res[v]
      })
      return newData
    }

    console.log(getUrlParams('http://deepwise.viewer.com?patientId=189438474&accessionNo=9819284122&sign=412415&timestamp=41251'))
  </script>
</body>

</html>